<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<title></title>
</head>

<body>
<script type="text/javascript">
    function getAbs(num){
        if(num<0){
            alert(num+"的绝对值是"+num*-1);
        }else{
            alert(num+"的绝对值是"+num);
        }
    }
    getAbs(-10);
</script>
</body>
</html>
